#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"../include/main.h"
#include"../include/narrtree.h"
#include"../include/listfile.h"
#include"../include/mount_vfs.h"
#include"../include/hash.h"
#include"../include/vfs_errorcodes.h"
#include"../include/create_vfs.h"

void list_file(char path[],char outfile[]) 
{
	char *pch,*pchh=NULL;
	pch=strrchr(path,'/');
	if(pch!=NULL)
	{
		pch++;
		pchh=strrchr(pch,'.');
	}
	if(mounted==0)
		printf("%s_FAILURE %s\n",glb_command,ERR_VFS_LISTFILE_04);
	else if(pchh != NULL)
	{
		if(strcmp(pchh,".txt"))
			printf("%s_FAILURE %s\n",glb_command,ERR_VFS_LISTFILE_02);
		else
			listfile1(path,outfile);
	}
}
